"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url

from . views import views,userviews,goodsviews,typesviews,orderviews

# 必须一个个地导入views，不能用*，*在这里不起作用

urlpatterns = [
    # 后台首页--比列表内容要少
    url(r'^$', views.index, name="myadmin_index"),
    url(r'^adminlogin/$', views.adminlogin, name="myadmin_login"),
    url(r'^adminlogout/$', views.adminloginout, name="myadmin_logout"),
    url(r'^adminvcode/$', views.verifycode, name="myadmin_vcode"),


    # 管理员列表路由
    url(r'^auth/user/$', views.authuser, name="myadmin_authuser"),
    # 管理员添加
    url(r'^authuser/add/$', views.authuseradd, name="myadmin_authuseradd"),

    # 授权组列表路由
    url(r'^auth/group/$', views.authgroup, name="myadmin_authgroup"),
    url(r'^authgroup/add/$', views.authgroupadd, name="myadmin_authgroup_add"),
    url(r'^authgroup/edit/(?P<gid>[0-9]+)/$', views.authgroupedit, name="myadmin_authgroup_edit"),


    # 会员管理： 增删改查

    # 添加页面与执行添加功能
    url(r'^user/add/$', userviews.add, name="myadmin_user_add"),
    url(r'^user/insert/$', userviews.insert, name="myadmin_user_insert"),
  
    url(r'^user/index/$', userviews.index, name="myadmin_user_index"),

    url(r'^user/delete/$', userviews.delete, name="myadmin_user_delete"),

    # 修改页面与执行修改
    url(r'^user/edit/(?P<uid>[0-9]+)/$', userviews.edit, name="myadmin_user_edit"),
    url(r'^user/update/$', userviews.update, name="myadmin_user_update"),


    # 分类管理，不轻易改动，可以选择改动商品页中与types的关联选项
    url(r'^types/add/$', typesviews.add, name="myadmin_types_add"),
    url(r'^types/insert/$', typesviews.insert, name="myadmin_types_insert"),
  
    url(r'^types/index/$', typesviews.index, name="myadmin_types_index"),

    url(r'^types/delete/$', typesviews.delete, name="myadmin_types_delete"),

    # 修改页面与执行修改
    url(r'^types/update/$', typesviews.update, name="myadmin_types_update"),
 


    # 商品管理
    url(r'^goods/add/$', goodsviews.add, name="myadmin_goods_add"),
    url(r'^goods/insert/$', goodsviews.insert, name="myadmin_goods_insert"),
  
    url(r'^goods/index/$', goodsviews.index, name="myadmin_goods_index"),

    url(r'^goods/delete/$', goodsviews.delete, name="myadmin_goods_delete"),

    # 修改页面与执行修改
    url(r'^goods/edit/(?P<gid>[0-9]+)/$', goodsviews.edit, name="myadmin_goods_edit"),
    url(r'^goods/update/$', goodsviews.update, name="myadmin_goods_update"),


    # 后台订单管理
    url(r'^adminorder/index/$', orderviews.index,name='myadmin_orders_list'),
]
